package com.zh.operation.service.impl;

import com.zh.common.utils.StringUtil;
import com.zh.operation.dao.OlderInOutDao;
import com.zh.operation.domain.OlderInOutDO;
import com.zh.operation.service.OlderInOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class OlderOlderInOutServiceImpl implements OlderInOutService {
	@Autowired
	private OlderInOutDao olderInOutDao;
	
	@Override
	public OlderInOutDO get(String id){
		return olderInOutDao.get(id);
	}
	
	@Override
	public List<OlderInOutDO> list(Map<String, Object> map){
		return olderInOutDao.list(map);
	}
	@Override
	public List<OlderInOutDO> listAll(Map<String, Object> map){
		return olderInOutDao.listAll(map);
	}
	@Override
	public int count(Map<String, Object> map){
		return olderInOutDao.count(map);
	}

	@Override
	public int count1(Map<String, Object> map) {
		return olderInOutDao.count1(map);
	}

	@Override
	public int save(OlderInOutDO inOut){
		inOut.setId(StringUtil.generalKeyword());//id
		inOut.setInDate(new Date());//签到时间
		inOut.setCreateDate(new Date());//创建时间
		return olderInOutDao.save(inOut);
	}
	
	@Override
	public int update(OlderInOutDO inOut){
		inOut.setOutDate(new Date());
		return olderInOutDao.update(inOut);
	}
	
	@Override
	public int remove(String id){
		return olderInOutDao.remove(id);
	}
	
	@Override
	public int batchRemove(String[] ids){
		return olderInOutDao.batchRemove(ids);
	}

    @Override
    public int selectCountManage() {
        return olderInOutDao.selectCountManage();
    }

	@Override
	public int selectCountEat() {
		return olderInOutDao.selectCountEat();
	}

	@Override
	public int selectCountCalling() {
		return olderInOutDao.selectCountCalling();
	}


}
